package net.ujacha.mvc.dao;

import java.util.List;

import net.ujacha.mvc.model.Board;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

@Repository
public class BoardDAO extends SqlSessionDaoSupport implements CrudDAO<Board>{

	@Override
	public Board select(Board board){
		return (Board) getSqlSession().selectOne("board.select", board);
	}
		
	@SuppressWarnings("unchecked")
	@Override
	public List<Board> selectList(Board board){
		return getSqlSession().selectList("board.selectList", board);
	}
	
	@Override
	public void insert(Board board){
		getSqlSession().insert("board.insert", board);
	}
	
	@Override
	public void update(Board board){
		getSqlSession().update("board.update", board);
	}
	
	@Override
	public void delete(Board board){
		getSqlSession().delete("board.delete", board);
	}

}
